Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for == operator on Termios #1

Merged
merged 2 commits into from Feb 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,4 +1,3 @@
#[allow(unstable)]
extern crate libc;
use self::libc::{c_void,c_int};

@@ -23,10 +22,7 @@ extern "C" {

#[cfg(target_os = "linux")]
mod os {
#[allow(unstable)]
extern crate libc;

use self::libc::{c_int,c_uint,c_uchar};
use super::libc::{c_int,c_uint,c_uchar};

#[allow(non_camel_case_types)]
pub type cc_t = c_uchar;
@@ -37,7 +33,7 @@ mod os {
#[allow(non_camel_case_types)]
pub type tcflag_t = c_uint;

#[derive(Show,Copy)]
#[derive(Debug,Copy,Eq,PartialEq)]
#[repr(C)]
pub struct Termios {
pub c_iflag: tcflag_t,
@@ -212,10 +208,7 @@ mod os {

#[cfg(target_os = "macos")]
mod os {
#[allow(unstable)]
extern crate libc;

use self::libc::{c_int,c_uchar,c_ulong};
use super::libc::{c_int,c_uchar,c_ulong};

#[allow(non_camel_case_types)]
pub type tcflag_t = c_ulong;
@@ -226,7 +219,7 @@ mod os {
#[allow(non_camel_case_types)]
pub type speed_t = c_ulong;

#[derive(Show,Copy)]
#[derive(Show,Copy,Eq,PartialEq)]
#[repr(C)]
pub struct Termios {
pub c_iflag: tcflag_t,
@@ -1,8 +1,7 @@
#[allow(unstable)]
extern crate libc;

use self::libc::{c_int};
use std::io::{IoError,IoResult};
use std::old_io::{IoError,IoResult};
use std::mem;
use std::default::Default;

@@ -93,7 +92,6 @@ pub fn cfsetspeed(termios: &mut Termios, speed: speed_t) -> IoResult<()> {


#[inline]
#[allow(unstable)]
fn io_result(result: c_int) -> IoResult<()> {
match result {
0 => Ok(()),